package com.lyy.entity.param;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author JoeZhou
 */
@Schema(name = "手机号码登录参数实体")
@Data
public class UserLoginByPhoneParam implements Serializable {

    @Schema(description = "验证码", required = true, example = "1234")
    @NotEmpty(message = "登录业务中验证码不能为空")
    @Pattern(regexp = "^\\w{4}$", message = "验证码必须由4位数字和字母组成")
    private String vcode;

    @Schema(description = "手机号码", required = true, example = "18210210122")
    @NotEmpty(message = "登录业务中手机号不能为空")
    @Pattern(regexp = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$", message = "手机号码格式不正确")
    private String phone;
}
